<style>
.body{
	border: 1px solid #999;
	padding: 10px;
	font-size: 14px;
}
.name-title{
	 font-size: 22px; 
	 text-align: center; 
	 font-weight: bold;
	 color:#2E2EFE;
	 text-transform: uppercase;
	 font-style: italic;
}
.page-title{
	 font-size: 22px; 
	 text-align: center; 
	 font-weight: bold;
	 color:#DF7401;
	 text-transform: uppercase;
}
.address-title{
	 font-size: 18px; 
	 text-align: center; 
	 font-weight: bold;
	 color:#DF7401;
	 text-transform: uppercase;
}
.logo{
	margin-right: 95px;
}
.line{
	border-bottom: 1px solid #ccc;
	height: 10px;
	margin-bottom: 15px;
}
.cell-top{
	vertical-align: top;
	padding-right: 20px;
	
}
.dt-label{
	width: 200px;
	
}
.dt-lb-content{
	font-style: italic;
	color: #2E2EFE;
	
}
.info-item{
	
}
.info-title{
	font-size: 18px;
	font-weight: bold;
	color: #DF7401;
}
.item-val{
	padding-left: 50px;
	color: #2E2EFE;
	
}
.item-des{
	padding-left: 100px;
}
.left{
	text-align: left;
}
.right{
	text-align: right;
}
.address{
	font-style: italic;
	color: #2E2EFE;
}
.cell-dt-val{
	font-style: italic;
	color: #2E2EFE;
	
}

.tbody-item{
	margin-bottom: 20px;
}
.cell-dt-label{
	width: 320px;
}
</style>
<body>
	<div class="logo">
		<img class="logo" src="/css/admin/img/global/longduc-logo-125x55.png"/><br/><br/>
		<span class="address-title">Long Duc Job Recruitment Center</span><br/>
		<span class="address">Long Duc Industrial Park - Long Thanh district - Dong Nai province, Vietnam</span><br/>
		Telephone: <span class="address">+84 - 61 - 368 - 1188</span><br/>
		Email: <span class="address">order@vieclamlongduc.com.vn</span>
	</div>
	<br/>
	<br/>
	<div class="page-title">Thông tin ứng viên/候補者情報</div>
	<?php $val = $data['candidate'];
		$photos = CandidatePhotosTable::getListByCandidateId($val['id']);	?>
		<div class="name-title"><?php echo $data['candidate']['full_name']?></div>
	<br/>
	<div class="body">
		
	
		<br/>
		<table border="0" width="100%">
			<tr>
				<td class="cell-top" width="200px">
					<img src="<?php echo empty($photos[0]['photo_url'])?sfConfig::get('app_no-image'):$photos[0]['photo_url']?>" style="width: 190px"/>
				</td>
				<td class="cell-top">
					<table border="0" width="100%">
							<tr>
								<td class="cell-dt-label"><?php echo __('label_identity_card',  null, 'candidate_candidates')?>: </td>
								<td class="cell-dt-label"><?php echo __('gender',  null, 'candidate_candidates')?>: </td>
								</tr>
							<tr>
								<td class="cell-dt-val"><?php echo $val['identity_card'] ?></td>
								<td class="cell-dt-val"><?php echo __('gender_'.str_replace('-','_', $val['gender']), null, 'array_data') ?></td>
							</tr>
							<tr><td colspan="2">&nbsp;</td></tr>
						
							<tr>
								<td class="cell-dt-label"><?php echo __('label_date_of_birth',  null, 'candidate_candidates')?>: </td>
								<td class="cell-dt-label"><?php echo __('is_married',  null, 'candidate_candidates')?>: </td>
							</tr>
							<tr>
								<td class="cell-dt-val"><?php echo DateHelper::dateFormatFree($val['date_of_birth'], 'Y-m-d') ?></td>
								<td class="cell-dt-val"><?php echo __('married_'.str_replace('-','_', $val['is_married']), null, 'array_data') ?></td>
							</tr>
							<tr><td colspan="2">&nbsp;</td></tr>
							
							<tr>
								<td class="cell-dt-label"><?php echo __('label_education_text',  null, 'candidate_candidates')?>: </td>
								<td class="cell-dt-label"><?php echo __('working_experience_foreign',  null, 'candidate_candidates')?>: </td>
							</tr>
							<tr>
								<td class="cell-dt-val"><?php echo empty($val['education'])?'&nbsp;':$val['education'] ?></td>
								<td class="cell-dt-val"><?php echo intval($val['working_experience_foreign'])?$val['working_experience_foreign']:__('experience_0', null, 'candidate_candidates'); ?></td>
							</tr>
							<tr><td colspan="2">&nbsp;</td></tr>
							
							<tr>
								<td class="cell-dt-label" colspan="2"><?php echo __('is_japan_training',  null, 'array_data')?>: </td>
							</tr>
							<tr>
								<td class="cell-dt-val" colspan="2"><?php echo __('is_japan_training_'.intval($val['is_japan_training']), null, 'array_data'); ?></td>
							</tr>
							<tr><td colspan="2">&nbsp;</td></tr>
							
							<tr>
								<td class="cell-dt-label"><?php echo __('label_working_status',  null, 'candidate_candidates')?>: </td>
								<td class="cell-dt-label">&nbsp;</td>
							</tr>
							<tr>
								<td class="cell-dt-val"><?php echo __('working_status_'.str_replace('-','_', $val['working_status']), null, 'array_data') ?></td>
								<td class="cell-dt-val">&nbsp;</td>
							</tr>
							<tr>
					</table>
				</td>
			</tr>
		</table>
		<div class="line">&nbsp;</div>
		
	<?php	$educations  = CandidateEducationsTable::getDataList(array('filter_candidate_id'=>$val['id']));
	if(count($educations)):?>
	<div class="info-title"><?php echo __('label_education_history',  null, 'candidate_candidates')?></div>
	<?php foreach($educations as $in):	
			$dateFrom = DateHelper::dateFormatFree($in['date_from'], 'Y-m');
			$dateTo = DateHelper::dateFormatFree($in['date_to'], 'Y-m');?>
	<div class="info-item">
		<div class="item-val"><?php echo  $in['education_school'] ?> </div>
		<div class="item-des"><span>Thời gian/ 期間: </span><span class="dt-lb-content"><?php echo $dateFrom, ' ~ ', $dateTo?></span></div>
		<div class="item-des"><span><?php echo __('major_subject', null, 'candidate_candidates')?>: </span><span class="dt-lb-content"><?php echo $in['major_subject']?></span></div>
		<div class="item-des"><span><?php echo __('education_level_id', null, 'candidate_candidates')?>: </span><span class="dt-lb-content"><?php echo $data['levels'][$in['education_level_id']]['name']?></span></div>
		<?php if(intval($in['is_checked'])):?><div class="item-des"><span class="dt-lb-content"><img src="/css/admin/img/global/control-enable.png"/> Đã xem qua bằng cấp/ 卒業証明書確認済み</span></div><?php endif;?>
	</div>
	<br/>
	<?php endforeach; ?>
	<div class="line">&nbsp;</div>
	<?php endif;
	$languages = CandidateToForeignLanguagesTable::getListByCandidateId($val['id']);
	if(count($languages)):?>
	<div class="info-title"><?php echo __('label_language',  null, 'candidate_candidates')?></div>
	<?php foreach($languages as $m):	?>
	<div class="info-item">
		<div class="item-val"><?php echo  $data['languages'][$m['foreign_language_id']]['name'] ?> </div>
		<div class="item-des"><span><?php echo __('language_level', null, 'candidate_candidates')?>: </span><span class="dt-lb-content"><?php echo $data['language_levels'][$m['foreign_language_level_id']]['name']?></span></div>
		<?php if(!empty($m['description'])):?><div class="item-des"><span><?php echo __('language_description', null, 'candidate_candidates')?>: </span><span class="dt-lb-content"><?php echo html_entity_decode(nl2br($m['description']))?></span></div><?php endif;?>
		<?php if(intval($m['is_checked'])):?><div class="item-des"><span class="dt-lb-content"><img src="/css/admin/img/global/control-enable.png"/> Đã xem qua bằng cấp/ 証明書確認済み</span></div><?php endif;?>
	</div>
	<br/>
	<?php endforeach; ?>
	<div class="line">&nbsp;</div>
	<?php endif;
	$technologies = CandidateToInformationTechnologiesTable::getListByCandidateId($val['id']);
	if(count($technologies)):	?>
	<div class="info-title"><?php echo __('label_information_technology',  null, 'candidate_candidates')?></div>
	<?php foreach($technologies as $m):?>
	<div class="info-item">
		<div class="item-val"><?php echo  $data['technologies'][$m['information_technology_id']]['name'] ?> </div>
		<div class="item-des"><span><?php echo __('information_technology_level', null, 'candidate_candidates')?>: </span><span class="dt-lb-content"><?php echo $data['technology_levels'][$m['information_technology_level_id']]['name']?></span></div>
		<?php if(!empty($m['description'])):?><div class="item-des"><span><?php echo __('language_description', null, 'candidate_candidates')?>: </span><span class="dt-lb-content"><?php echo html_entity_decode(nl2br($m['description']))?></span></div><?php endif;?>
		<?php if(intval($m['is_checked'])):?><div class="item-des"><span class="dt-lb-content"><img src="/css/admin/img/global/control-enable.png"/> Đã xem qua bằng cấp/ 証明書確認済み</span></div><?php endif;?>
	</div>
	<br/>
	<?php endforeach;?>
	<div class="line">&nbsp;</div>
	<?php endif;
	$skill = CandidateOtherSkillesTable::getListByCandidateId($val['id']);
	if(count($skill)):?>
	<div class="info-title"><?php echo str_replace('<br/>',' ',__('more_skill',  null, 'candidate_candidates'))?></div>
	<?php foreach($skill as $m): ?>
	<div class="info-item">
		<div class="item-val"><?php echo  $m['skill']?> </div>
		<?php if(!empty($m['description'])):?><div class="item-des"><?php echo html_entity_decode(nl2br($m['description']))?></div><?php endif;?>
		<?php if(intval($m['is_checked'])):?><div class="item-des"><span class="dt-lb-content"><img src="/css/admin/img/global/control-enable.png"/> Đã xem qua bằng cấp/ 卒業証明書確認済み</span></div><?php endif;?>
	</div>
	<br/>
	<?php endforeach;?>
	<div class="line">&nbsp;</div>
	<?php endif;
	$works = CandidateWorkingHistoriesTable::getDataList(array('filter_candidate_id' => $val['id']));
	if(count($works)):?>
	<div class="info-title"><?php echo __('label_working_history',  null, 'candidate_candidates')?></div>
	<?php foreach($works as $m):	
		$dateFrom = DateHelper::dateFormatFree($m['date_from'], 'Y-m');
		$dateTo = DateHelper::dateFormatFree($m['date_to'], 'Y-m');
		$year = intval(date('Y',strtotime($m['date_to']))) - intval(date('Y',strtotime($m['date_from'])));
		if (intval($year) == 0){
			$year = 'dưới 1 năm/ 1年以下';
		}else{
			$year.=' năm/ 年';
		}?>
	<div class="info-item">
		<div class="item-val"><?php echo $dateFrom, ' ~ ', $dateTo,': ', $year ?> </div>
		<div class="item-des"><span><?php echo __('history_company_name', null, 'candidate_candidates')?>: </span><span class="dt-lb-content"><?php echo $m['company_name']?></span></div>
		<div class="item-des"><span><?php echo __('history_job_position_id', null, 'candidate_candidates')?>: </span><span class="dt-lb-content"><?php echo $data['job_positions'][$m['job_position_id']]['name']?></span></div>
		<div class="item-des"><span><?php echo __('history_position_id', null, 'candidate_candidates')?>: </span><span class="dt-lb-content"><?php echo $data['positions'][$m['position_id']]['name']?></span></div>
		<?php if(!empty($m['work_description'])):?><div class="item-des"><span><?php echo __('language_description', null, 'candidate_candidates')?>: </span><span class="dt-lb-content"><?php echo html_entity_decode(nl2br($m['work_description']))?></span></div><?php endif;?>
		
	</div>
	<br/>
	<?php endforeach; ?>
	<div class="line">&nbsp;</div>
	<?php endif;
	$majors = CandidateToMajorsTable::getListByCandidateId($val['id']);
	if(count($majors)):?>
	<div class="info-title"><?php echo __('label_major',  null, 'candidate_candidates')?></div>
	<?php foreach($majors as $m):?>
	<div class="info-item">
		<div class="item-val"><?php echo  $data['majors'][$m['major_id']]['name']?> </div>
		<?php if(!empty($m['description'])):?><div class="item-des"><?php echo html_entity_decode(nl2br($m['description']))?></div><?php endif;?>
	</div>
	<br/>
	<?php endforeach;?>
	<?php endif;
	if(!empty($val['remark'])):?>
	<div class="info-title"><?php echo __('label_remark',  null, 'candidate_candidates')?></div>
	<div class="item-val">
		<?php echo html_entity_decode(nl2br($val['remark']))?>
	</div>
	<br/>
	<?php endif;?>
	<div class="info-title"><?php echo __('register_date',  null, 'candidate_candidates')?></div>
	<div class="item-val">
		<?php echo DateHelper::dateFormatFree($val['register_date'], 'Y-m-d')?>
	</div>
</div>  
<br/><br/>
<table border="0" width="100%">
	<tr><td class="left"><img class="logo" src="/css/admin/img/global/sotochika-logo-125x55.png"/></td>
	<td class="right"><img src="/css/admin/img/global/ibs-logo-125x44.png"/></td></tr>
</table>
</body>
					